<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<head>
<title><spring:message code="admin.paybonus.titile" /></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<link rel="stylesheet"
	href="<c:url value="/javascripts/jscalendar/theme/calendar-system.css"/>" />
<script language="javascript"
	src="<c:url value="/javascripts/common.js"/>"></script>
<script src="<c:url value="/javascripts/jscalendar/calendar-cfg.js"/>"></script>
<script src="<c:url value="/javascripts/calendar.js"/>"></script>
<script
	src="<c:url value="/javascripts/jscalendar/lang/calendar-en.js"/>"></script>
<script src="<c:url value="/javascripts/jscalendar/calendar-setup.js"/>"></script>
<script language="javascript" type="text/javascript">
function updateDropdown(e,val){
	for(var i=0;i<e.length;i++)
	  {
   		 if(e[i].value == val)
   		   {e.selectedIndex = i;break;}
	  }
}

</script>
</head>
<body><%@include file="../top_menu.jsp"%>
<table width=100%>
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/admin_bonus_menu.jsp" /><br />
		</td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>
</table>

<table width=70% class="formTable">

	<tr class="formHeader">
		<td colspan="5"><spring:message code="admin.paybonus.label.bonusreport" /></td>
	</tr>

	<tr>
		<td colspan="2">
		<table>

			<c:if test="${paymentDoneMsg != null}">
				<h3>${paymentDoneMsg}</h3>
			</c:if>

			<c:if test="${bonus != null}">
				<tr>
					<td colspan="2">
					<table>
						<tr>
							<td><form:form commandName="payBonusForm" method="post">


								<c:if test="${payMode == 'pay'}">
                             <spring:message code="admin.paybonus.label.pay" /> ${reportOwner.email} <spring:message code="admin.paybonus.label.now" />
                             <spring:message code="admin.paybonus.label.for" />
                             <input type="text" size="4"
										name="payAmount" value="${bonusResult.unpaidBalance}"
										maxVal="${bonusResult.unpaidBalance}"></input>
								</c:if>

								<c:if test="${payMode == 'payOn'}">
                             <spring:message code="admin.paybonus.label.pay" /> ${reportOwner.email} <spring:message code="admin.paybonus.label.on" /> <component:calendar
										bindPath="payOn" /> 
                            <spring:message code="admin.paybonus.label.for" />
                             <input type="text" size="4"
										name="payAmount" value="${bonusResult.unpaidBalance}"
										maxVal="${bonusResult.unpaidBalance}"></input>
								</c:if>

								<c:if test="${payMode == 'payWhen'}">
                            <spring:message code="admin.paybonus.label.pay" /> ${reportOwner.email} <spring:message code="admin.paybonus.label.whenbalance" /> &gt;= <input
										type="text" name="payWhen" value="" size="4" />
								</c:if>
                             
                             <spring:message code="admin.paybonus.label.as" /> <select name="payAs">
									<option value="1" selected><spring:message code="admin.paybonus.option.cash" /></option>
									<option value="2"><spring:message code="admin.paybonus.option.discount" /></option>
								</select>
								<br />
								<input type="submit" class='ui-button ui-state-default ui-corner-all' value="<spring:message code="admin.paybonus.button.ok" />" /> &nbsp;
                      		 <input type="button" class='ui-button ui-state-default ui-corner-all' value="<spring:message code="admin.paybonus.button.back" />"
									onclick="history.back();" />
							</form:form></td>
						</tr>

					</table>
					</td>
				</tr>
			</c:if>
		</table>
		</td>
	</tr>


</table><%@include file="/WEB-INF/jsp/include/footer.jsp"%>
</body>
</html>